/*****************************************************************************
 * $LastChangedDate: 2011-04-23 21:07:07 -0400 (Sat, 23 Apr 2011) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Vector/vertex types.
 *//*
 * LEGAL:   COPYRIGHT (C) 2004 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#define MATH_VERTEX_CC 1
#include "base/module.hh"
#include "base/stream.hh"
using namespace base;
#include "math/module.hh"
#include "math/vertex.hh"

//==============================================================================
// KLUDGE: To compile operator<<(osg::Vec3), place inside the osg namespace.
//==============================================================================
#if ! DOXYGEN
namespace osg {

/*****************************************************************************
 * operator<<(Vector2)
 *****************************************************************************/
std::ostream& operator<<( std::ostream& strm, const math::Vector2& v )
{
    std::ios::fmtflags savedFlags = strm.flags();
    strm << "Vector2:("
         << OMANIP_FIELD(8) << v[math::XX] << ','
         << OMANIP_FIELD(8) << v[math::YY] << ')';
    strm.flags(savedFlags);
    return strm;
}

/*****************************************************************************
 * operator<<(Vector3)
 *****************************************************************************/
std::ostream& operator<<( std::ostream& strm, const math::Vector3& v )
{
    std::ios::fmtflags savedFlags = strm.flags();
    strm << "Vector3:("
         << OMANIP_FIELD(8) << v[math::XX] << ','
         << OMANIP_FIELD(8) << v[math::YY] << ','
         << OMANIP_FIELD(8) << v[math::ZZ] << ')';
    strm.flags(savedFlags);
    return strm;
}

} // namespace osg
#endif // ! DOXYGEN
//==============================================================================
